//
// Created by 张珺超 on 2019/10/17.
//

#ifndef PACIONE_CONSOLECOLORIZER_H
#define PACIONE_CONSOLECOLORIZER_H

#include "warlocklib_global.h"
#include <string>
#include <map>

#define CSI_HEAD "\033["
#define CSI_TAIL "m"

WARLOCK_NS_BEGIN
class WARLOCKLIBSHARED_EXPORT ConsoleColorizer {
SIMPLE_PROPERTY(bool, enabled, Enabled, true)

public:
  ConsoleColorizer() = default;

  [[nodiscard]] std::string reset() const;

  [[nodiscard]] std::string code(const std::string &codeText) const;

protected:
  static const std::map<std::string, std::string> m_codeMap;
};
WARLOCK_NS_END

#endif //PACIONE_CONSOLECOLORIZER_H
